<template>
  <el-select :model-value="props.modelValue" @update:model-value="changeValue" v-bind="$attrs">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>
<script setup lang="ts">
const props = defineProps({
  modelValue: {
    type: Number,
    default: 60
  }
}) as {
  modelValue: number
}
const options = [
  {
    label: '过去1小时',
    value: 60
  }, {
    label: '过去2小时',
    value: 60 * 2
  }, {
    label: '过去4小时',
    value: 60 * 4 
  }, {
    label: '过去6小时',
    value: 60 * 6
  }, {
    label: '过去12小时',
    value: 60 * 12
  }, {
    label: '过去24小时',
    value: 60 * 24
  }, {
    label: '过去48小时',
    value: 60 * 48
  }
]
const emits = defineEmits(['update:modelValue'])
const changeValue = (val: number) => {
  emits('update:modelValue', val)
}

</script>
